import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '业务日期',
    align: "center",
    dataIndex: 'businessDate',
    customRender:({text}) =>{
      text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
      return text;
    },
    resizable:true
  },
  {
    title: '销售组织',
    align: "center",
    dataIndex: 'salesOrganization',
    resizable:true
  },
  {
    title: '部门',
    align: "center",
    dataIndex: 'department',
    resizable:true
  },
  {
    title: '客户',
    align: "center",
    dataIndex: 'client',
    resizable:true
  },
  {
    title: '品牌',
    align: "center",
    dataIndex: 'brand',
    resizable:true
  },
  {
    title: '物料分组',
    align: "center",
    dataIndex: 'materialGroup',
    resizable:true
  },
  {
    title: '旺店通编码',
    align: "center",
    dataIndex: 'wdtCode',
    resizable:true
  },
  {
    title: '物料编码',
    align: "center",
    dataIndex: 'materialCode',
    resizable:true
  },
  {
    title: '物料名称',
    align: "center",
    dataIndex: 'materialName',
    resizable:true
  },
  {
    title: '货品收入',
    align: "center",
    dataIndex: 'goodsIncome',
    resizable:true
  },
  {
    title: '货品成本',
    align: "center",
    dataIndex: 'costGoods',
    resizable:true
  },
  {
    title: '货品数量',
    align: "center",
    dataIndex: 'num',
    resizable:true
  },
  {
    title: '货品重量',
    align: "center",
    dataIndex: 'weight',
    resizable:true
  },
  {
    title: '运输成本',
    align: "center",
    dataIndex: 'shippingCost',
    resizable:true
  },
  {
    title: '毛利额',
    align: "center",
    dataIndex: 'grossProfit',
    resizable:true
  },
  {
    title: '毛利率',
    align: "center",
    dataIndex: 'grossProfitMargin',
    resizable:true
  },
  {
    title: '税金及附加',
    align: "center",
    dataIndex: 'taxesSurcharges',
    resizable:true
  },
  {
    title: '销售费用-广告费',
    align: "center",
    dataIndex: 'adsFees',
    resizable:true
  },
  {
    title: '销售费用-资金账单扣费',
    align: "center",
    dataIndex: 'fundsBillDeduction',
    resizable:true
  },
  {
    title: '销售费用-人员费用',
    align: "center",
    dataIndex: 'personnelExpenses',
    resizable:true
  },
  {
    title: '销售费用-其他',
    align: "center",
    dataIndex: 'otherExpenses',
    resizable:true
  },
  {
    title: '管理费用',
    align: "center",
    dataIndex: 'managementFees',
    resizable:true
  },
  // {
  //   title: '财务费用',
  //   align: "center",
  //   dataIndex: 'financialExpenses',
  //   resizable:true
  // },
  {
    title: '营业利润',
    align: "center",
    dataIndex: 'operatingProfit',
    resizable:true
  },
  // {
  //   title: '营业外收入',
  //   align: "center",
  //   dataIndex: 'nonOperatingIncome',
  //   resizable:true
  // },
  // {
  //   title: '营业外支出',
  //   align: "center",
  //   dataIndex: 'nonOperatingExpenses',
  //   resizable:true
  // },
  {
    title: '利润总额',
    align: "center",
    dataIndex: 'totalProfit',
    resizable:true
  },
  {
    title: '所得税费用',
    align: "center",
    dataIndex: 'incomeTaxExpense',
    resizable:true
  },
  {
    title: '净利润',
    align: "center",
    dataIndex: 'netProfit',
    resizable:true
  },
  {
    title: '净利率',
    align: "center",
    dataIndex: 'netProfitMargin',
    resizable:true
  },
];

// 高级查询数据
export const superQuerySchema = {
  businessDate: {title: '业务日期',order: 0,view: 'date', type: 'string',},
  salesOrganization: {title: '销售组织',order: 1,view: 'text', type: 'string',},
  department: {title: '部门',order: 2,view: 'text', type: 'string',},
  client: {title: '客户',order: 3,view: 'text', type: 'string',},
  brand: {title: '品牌',order: 4,view: 'text', type: 'string',},
  materialGroup: {title: '物料分组',order: 5,view: 'text', type: 'string',},
  wdtCode: {title: '旺店通编码',order: 6,view: 'text', type: 'string',},
  materialCode: {title: '物料编码',order: 7,view: 'text', type: 'string',},
  materialName: {title: '物料名称',order: 8,view: 'text', type: 'string',},
  goodsIncome: {title: '货品收入',order: 9,view: 'number', type: 'number',},
  costGoods: {title: '货品成本',order: 10,view: 'number', type: 'number',},
  shippingCost: {title: '运输成本',order: 11,view: 'number', type: 'number',},
  grossProfit: {title: '毛利额',order: 12,view: 'number', type: 'number',},
  grossProfitMargin: {title: '毛利率',order: 13,view: 'text', type: 'string',},
  taxesSurcharges: {title: '税金及附加',order: 14,view: 'number', type: 'number',},
  adsFees: {title: '销售费用-广告费',order: 15,view: 'number', type: 'number',},
  fundsBillDeduction: {title: '销售费用-资金账单扣费',order: 16,view: 'number', type: 'number',},
  personnelExpenses: {title: '销售费用-人员费用',order: 17,view: 'number', type: 'number',},
  otherExpenses: {title: '销售费用-其他',order: 18,view: 'number', type: 'number',},
  managementFees: {title: '管理费用',order: 19,view: 'number', type: 'number',},
  financialExpenses: {title: '财务费用',order: 20,view: 'number', type: 'number',},
  operatingProfit: {title: '营业利润',order: 21,view: 'number', type: 'number',},
  nonOperatingIncome: {title: '营业外收入',order: 22,view: 'number', type: 'number',},
  nonOperatingExpenses: {title: '营业外支出',order: 23,view: 'number', type: 'number',},
  totalProfit: {title: '利润总额',order: 24,view: 'number', type: 'number',},
  incomeTaxExpense: {title: '所得税费用',order: 25,view: 'number', type: 'number',},
  netProfit: {title: '净利润',order: 26,view: 'number', type: 'number',},
  netProfitMargin: {title: '净利率',order: 27,view: 'number', type: 'number',},
};
